<?php
require_once 'database/Product.php';
require_once 'database/DatabaseConnection.php';
require_once 'command/GetProductsByTagsCommand.php';

class ProductTest {
	
	private $product;
	private $id = "E00401000CAEB05A";
	private $ids = "E00401003EE447907;E00401000EFF3651";
	private $GPBTCid;
	private $GPBTCids;
	
	public function __construct() {
		$this->product = new Product();
		$this->GPBTCid = new GetProductsByTagsCommand($this->id);
		$this->GPBTCids = new GetProductsByTagsCommand($this->ids);
	}
	
	public function testGetAllProduct() {
		$bool = true;
		DatabaseConnection::connect();
		$arrObj = $arrObj = $this->product->getAllProducts();
		if(!is_object($arrObj)){
			$bool = false;
		}
		DatabaseConnection::disconnect();
		return $bool;
	}
	
	/**
	 * 
	 * Enter description here ...
	 */
	public function testGetProductByTagsCommand(){
		echo "Single id:".htmlspecialchars($this->GPBTCid->execute())."<br>";
		echo "Two ids:".htmlspecialchars($this->GPBTCids->execute())."<br>";
	}
}